package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.ApAuthDto;
import com.heima.model.user.dtos.ApAuthPassOrFailDto;
import com.heima.model.user.pojos.ApUserRealname;
import com.heima.user.service.IApUserAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 后台管理端,用户认证审核
 */
@RestController
@RequestMapping("/api/v1/auth")
public class ApUserAuthController {
    @Autowired
    private IApUserAuthService apUserAuthService;
    /**
     * 后台管理端查询用户认证情况
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult findByPage(@RequestBody ApAuthDto dto){
        return apUserAuthService.findByPage(dto);
    }

    /**
     * 后台管理,用户认证审核,通过
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody ApAuthPassOrFailDto dto){
        return apUserAuthService.authPass(dto);
    }

    /**
     * 用户认证---审核失败
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody ApAuthPassOrFailDto dto){
        return apUserAuthService.authFail(dto);
    }
}
